import 'package:base_flutter/base_flutter.dart';
import 'package:base_package_init/net/common_apis.dart';

import '../net/response/decode_qrcode_data.dart';

class DecodeQrcodeModel extends BaseMvvmModel{
  @override
  void onCleared() {
  }

  Future<DecodeQrcodeData> decoed(String code) async {
    var map = {'code': code};
    var data = await HttpGo.instance
        .postData(CommonApis.decodeQrcode, data: map, options: urlHead);
    if("0"==data['code'].toString()){
      var result =  DecodeQrcodeData.fromJson(data['data']);
      return result;
    }else{
      throw data['msg'];
    }
  }

}